//
//  MYNewsShopDetailsTicketCell.swift
//  MuYing
//
//  Created by tbb on 2020/3/6.
//  Copyright © 2020 TBB. All rights reserved.
//

import UIKit

class MYNewsShopDetailsTicketCell: YQTableViewBaseCell {
    
    @objc var ticketBuyBlock:((_ :MYNewsShopDetailsStandardTicketModel) -> ())?
    
    @objc var ticketModel:MYNewsShopDetailsStandardTicketModel?{
        didSet {
            self.typeLb.text = self.ticketModel?.ticketName;
            self.oldLb.text = "";
            self.priceLb.text = String(format: "￥ %@", self.ticketModel?.ticketPrice ?? "0.00");
        }
    }

    @IBOutlet weak var typeLb: UILabel!
    @IBOutlet weak var oldLb: UILabel!
    
    @IBOutlet weak var buyBtn: UIButton!
    
    @IBOutlet weak var priceLb: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
        self.buyBtn.layer.cornerRadius = 16;
        self.buyBtn.layer.borderColor = UIColorFromHex(rgbValue: 0xF88282).cgColor;
        self.buyBtn.layer.borderWidth = 1;
        self.buyBtn.addTarget(self, action: #selector(buyAction(_:)), for: .touchUpInside)
        self.buyBtn.setTitle(kYQLSSwift("预订"), for: .normal);
        self.typeLb.text = kYQLSSwift("成人");
    }
    
    @objc func buyAction(_ sender:UIButton) {
        if let ticketBuyBlock = self.ticketBuyBlock,let ticketModel = self.ticketModel {
            ticketBuyBlock(ticketModel);
        }
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
